//
//  ButtonModel.m
//  穷游项目
//
//  Created by 刘建镇 on 14-12-29.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//
#import "macro.h"
#import "ButtonModel.h"

@implementation ButtonModel

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc
{
    [_label release];
    [_imageV release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (SCREEN_WIDTH - 30)/2, SCREEN_WIDTH/3)];
        [self addSubview:_imageV];
        [_imageV release];
        self.label = [[UILabel alloc] initWithFrame:CGRectMake(3, SCREEN_WIDTH/2, (SCREEN_WIDTH - 30)/2, self.frame.size.height - SCREEN_WIDTH/3)];
        _label.backgroundColor = [UIColor clearColor];
        _label.adjustsFontSizeToFitWidth = YES;
        _label.textAlignment = NSTextAlignmentLeft;
        _label.numberOfLines = 0;
        _label.font = [UIFont fontWithName:@"Helvetica" size:13.f];
        [_label release];
        [self addSubview:_label];
    }
    return self;
}
@end
